<?php
/**待受理
 * Created by leiying
 * Date: 2018-06-11
 * Time: 18:25:09
 */

namespace Admin\Controller;


use Think\Controller;

class TemplateController extends Controller
{
    /**
     * @author leiying
     */
    public function complete(){
        if(I('post.btn')){$this->success('');}
        if(IS_POST){
           $this->error("非法操作");
        }else{
            $id = I('get.id');
            if(empty($id)){
                $this->error("请选择需要操作的数据");
            }
            $res = M('apply')->alias("a")->field("a.*,b.name project_name")->join(C('DB_PREFIX')."project b ON a.p_id = b.id","left")->where(array('a.id'=>$id))->find();
            $this->assign('res',$res);

            $opinions = M("depart_opinion")->alias("a")
                ->field("a.*,b.nickname,c.name depart_name")
                ->join(C('DB_PREFIX')."member b ON a.uid = b.uid","left")
                ->join(C('DB_PREFIX')."department c ON a.depart_id = c.id","left")
                ->where(array("apply_id"=>$id))->select();
            $this->assign("opinions",$opinions);

            $p = I('get.p',"1");
            $this->assign('p',$p);
            $this->display();
        }
    }

}